
#include "common.hpp"

// Common helper functions

std::vector<std::string> tokenize(std::string str, const char sep)
{
	std::vector<std::string> tokens;
	str += " ";
	
	for(unsigned int start = 0, end = 0; end < str.length(); end++)
		if(str[end] == sep || end == str.length() - 1) {
			tokens.push_back(str.substr(start, end - start));
			start = end++;
			start++;
		}
	
	return tokens;
}
